Can we use "Contains" and "NotContains" methods in SQL i.e., How do I check if a string or a column value is contained in another column of a table.
Problem Statement:
If not SQL can we use JavaScript UDF or any other means to make this happen?
Returns true if expr1 contains expr2. Both expressions must be text or binary expressions.
CONTAINS( <expr1> , <expr2> )
Examples:
SELECT * FROM tab WHERE (Colum1, 'ABC');
SELECT * FROM tab WHERE NOT (Colum1, 'ABC');
SELECT * FROM tab WHERE (Colum1, Column2);
SELECT * FROM tab WHERE NOT (Colum1, Column2);
It is worth mentioning Snowflake LIKE/ILIKE [ANY]:
SELECT *
FROM tab
WHERE Column1 LIKE ANY ('%ABC%','%XYZ%');
You can use Like operator I believe i am not sure what exactly are you looking for but here is an example below. For more details: https://www.w3schools.com/sql/sql_like.asp
select column
from [table]
where column Like %ABC%
or if you already know the values that you are looking for in a specific column then you can use in operator:
select column from [table] where column in ('ABC','XYZ')
This will give you the rows for the column, where the values are equal to either ABC or XYZ